package name.zxw.rabbitmq.dead;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.ConnectionFactory;

/**
 * @author zhangxinwang
 * @date 2022/6/23 10:04
 */
public class MyConsumer2 {

    private static final String NORMAL_EXCHANGE = "normal_exchange";
    private static final String DEAD_EXCHANGE = "dead_exchange";
    private static final String NORMAL_QUEUE = "normal_queue";
    private static final String DEAD_QUEUE = "dead_queue";
    private static final String NORMAL_ROUTING_KEY = "zhangsan";
    private static final String DEAD_ROTING_KEY = "list";


    public static void main(String[] args) throws Exception {
        //x-message-ttl
        //x-dead-letter-exchange
        //x-dead-letter-routing-key
        //x-max-length

        //durable exclusive

        ConnectionFactory factory = new ConnectionFactory();
        Channel channel = factory.newConnection().createChannel();

        channel.basicConsume(DEAD_QUEUE,true,
                (consumerTag, message) -> System.out.println("接收到消息: " + new String(message.getBody())),
                consumerTag -> {}
        );


    }


}
